﻿@model WebDomain.Entities.Product

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm("Create", "Admin",FormMethod.Post, new { enctype = "multipart/form-data"}))
{
    @Html.EditorForModel()
    <br />
    <div class="editor-label">Image</div>
    <div class="editor-field">
    @if (Model != null)
    {
        if (Model.ImageData == null)
        {
            @:None
        }
        else
        {
            <img width="150" src="~/@Url.Action("GetImage", "Product", new { Model.ID })" alt="@Model.Name" />
        }
    }
        <div>Upload new image: <input type="file" name="Image"/></div>
    </div>
    <input type="submit" value="Save" />
    @Html.ActionLink("Cancel", "Products")
}